import Icon from './icon/index.js'
import Button from './button/index.js'
import Row from './row/index.js'
import Col from './col/index.js'
import Cell from './cell/index.js'
import CellGroup from './cell-group/index.js'
import Switch from './switch/index.js'
import Grid from './grid/index.js'
import GridItem from './grid-item/index.js'
import Card from './card/index.js'
import ActionSheet from './action-sheet/index.js'
import Modal from './modal/index.js'
import Drawer from './drawer/index.js'

/*****视图组件****/
import Tag from './tag/index.js'
import Progress from './progress/index.js'
import Divider from './divider/index.js'

/*****表单组件****/
import Radio from './radio/index.js'
import RadioGroup from './radio-group/index.js'
import Rate from './rate/index.js'


const components = [
    Icon,
    Button,
    Row,
    Col,
    Cell,
    CellGroup,
    Switch,
    Grid,
    GridItem,
    Card,
    ActionSheet,
    Modal,
    Drawer,
    
    
    Tag,
    Progress,
    Divider,
    
    Rate,
    Radio,
    RadioGroup,
]

// 定义 install 方法，接收 Vue 作为参数
const install = function (Vue) {
    // 判断是否安装，安装过就不继续往下执行
    if (install.installed) return;
    install.installed = true;
    
    components.map(component => {
        Vue.component('Jk' + component.name, component)
    });
    
};

export default {
    install,
    ...components
}